package com.ccys.cms.service.productAndService.impl;

import com.ccys.cms.service.productAndService.ClassOfDrugService;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.web.productAndService.ClassOfDrugDto;
import com.ccys.db.entity.TblDrugClass;
import com.ccys.db.mapper.TblDrugClassMapper;
import com.ccys.db.page.PageDto;
import com.ccys.db.rely.service.impl.BaseServiceImpl;
import com.ccys.db.vo.web.productAndService.ClassOfDrugVo;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
@Slf4j
public class ClassOfDrugServiceImpl extends BaseServiceImpl<TblDrugClass> implements ClassOfDrugService {

    @Resource
    private TblDrugClassMapper mapper;

    @Override
    public ResponseResult getPage(ClassOfDrugDto dto) {
        PageDto.startPage();
        List<ClassOfDrugVo> list = mapper.getList(dto);
        PageInfo<ClassOfDrugVo> info = new PageInfo<>(list);
        return ResponseResult.success(info);
    }
}
